-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add remote pinning to ipfs command #7661
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for starting this. Quick feedback:
- Needs to be updated to https://github.com/ipfs/pinning-services-api-spec/releases/tag/v0.1.0
id
is renamed torequestid
now, for sake fo consistency go-ipfs should replace all occurences ofID
withRequestID
This adds basic boilerplate for supporting remote pinning commands introduced in ipfs/kubo#7661 License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
@petar is the API under |
@lidel Yes. The additional API for configuring remote services "/pin/remote/service" hasn't been reviewed by others carefully yet. Feel free to criticize it if you get to it. It meets @aschmahmann 's considerations, I believe. |
@lidel I haven't had a chance to look at the The rest of the |
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
@Gozala thanks for feedback! Quick thoughts:
|
Well problem is that it would also affect JS CLI which in turn would be bound to the implementation or will have to take a more custom approach |
Sounds to me that maybe it should be a |
I thought JS didn't have as strong coupling between the CLI and HTTP API as Go did, am I misunderstanding? Fundamentally Go, JS, and Bash all have different each have their own semantics about what's preferred so moving around some things on the interface in JS seems reasonable unless it's a big pain. For example, what happens when we want to extend the number of services to be 1 or more? That's not easily implemented via just a
🤷 I think both options are acceptable. I'm pretty sure we discussed this and @Gozala's suggestion
but decided not to since we might want |
While discussing issues raised by @Gozala we took a quick step back and looked at Below are quick notes from our call, so we have our rationale documented. With
|
Rationale: #7661 (comment) Note: one config test fails due to unrelated changes, this will be addressed separatelly.
We will replace this with smarter logic in separate PR with MFSRepinInterval
One more thing I've noticed with ipfs pin remote service ls --pin-count
mock http://localhost:8080 1/0/0/0
test http://localhost:8080 offline Same call over the HTTP endpoint curl -X POST 'http://127.0.0.1:5002/api/v0/pin/remote/service/ls?pin-count=true'
{
"RemoteServices": [
{
"Service": "mock",
"ApiEndpoint": "http://localhost:8080",
"PinCount": {
"Queued": 1,
"Pinning": 0,
"Pinned": 0,
"Failed": 0
}
},
{
"Service": "test",
"ApiEndpoint": "http://localhost:8080"
}
]
} Note that in CLI one can tell that service is not reachable, while over HTTP only clue is lack of curl -X POST 'http://127.0.0.1:5002/api/v0/pin/remote/service/ls?stat=true'
{
"RemoteServices": [
{
"Service": "mock",
"ApiEndpoint": "http://localhost:8080",
"Stat": {
"Status": "Online",
"PinCount": {
"Queued": 1,
"Pinning": 0,
"Pinned": 0,
"Failed": 0
}
}
},
{
"Service": "test",
"ApiEndpoint": "http://localhost:8080"
"Stat": {
"Status": "Offline"
}
}
]
}
|
Oh and also "online" | "offline" may no be a good working here, maybe "available" | "unavailable" or "reachable" | "unreachable" might be a better way to talk about it. Because node may be offline instead of service or maybe service is unreachable because of network fragmentation. |
Applying suggestions from #7661 (comment)
@Gozala good feedback, thanks! Without {
"RemoteServices": [
{
"Service": "test-valid",
"ApiEndpoint": "https://testapi1.example.com/psa",
"Stat": {
"Status": "unknown"
}
},
{
"Service": "test-invalid",
"ApiEndpoint": "https://testapi2.example.com/psa",
"Stat": {
"Status": "unknown"
}
}
]
}
With {
"RemoteServices": [
{
"Service": "test-valid",
"ApiEndpoint": "https://testapi1.example.com/psa",
"Stat": {
"Status": "valid",
"PinCount": {
"Queued": 0,
"Pinning": 0,
"Pinned": 2,
"Failed": 0
}
}
},
{
"Service": "test-invalid",
"ApiEndpoint": "https://testapi2.example.com/psa",
"Stat": {
"Status": "invalid"
}
}
]
}
|
Thanks @lidel! Do you think it would make sense to only include |
@Gozala sgtm – changed in Without {
"RemoteServices": [
{
"Service": "test-valid",
"ApiEndpoint": "https://testapi1.example.com/psa"
},
{
"Service": "test-invalid",
"ApiEndpoint": "https://testapi2.example.com/psa"
}
]
}
|
593ffd0
to
0cc482d
Compare
Added support for remote pinning services A pinning service is a service that accepts CIDs from a user in order to host the data associated with them. The spec for these services is defined at https://github.com/ipfs/pinning-services-api-spec Support is available via the `ipfs pin remote` CLI and the corresponding HTTP API Co-authored-by: Petar Maymounkov <petarm@gmail.com> Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
Part of #7559
Ref.